﻿using System;
using System.Globalization;
using Avalonia.Data.Converters;

namespace MinecraftEnchantCalculator.Converters.Xaml;

public class RomanConverter : IValueConverter
{
  public object? Convert(
    object? value, Type targetType, object? parameter, CultureInfo culture
  )
  {
    if (value is int level)
      return RomanNumeralConverter.ToRoman(level);

    return null;
  }

  public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
  {
    throw new NotImplementedException();
  }
}